package ch.usi.inf.pf2.alu.nodes;

import ch.usi.inf.pf2.cell.Data;
import ch.usi.inf.pf2.cell.Value;

/**
 * 
 * @author Yotam Sharon
 * 
 */

public class NegationNode implements Node {

	private final Node node;

	public NegationNode(final Node node) {
		this.node = node;
	}

	public final Data evaluate() {
		Value v = (Value) node.evaluate();
		Data d = new Value(-v.getInstanceDouble());
		return d;
	}
}
